package com.day12_Thread.BoxDemo;

/**
 * @ClassName: BoxDemo
 * @Author: zw
 * @Description: 出百万拳，行万里路；
 * @Create 2024/3/24-01:09
 * @Version 1.0
 */
public class BoxDemo {

    // 生产者消费者案例
    public static void main(String[] args) {
        // 创建奶箱对象
        Box box = new Box();
        // 创建生产者对象
        Producer producer = new Producer(box);
        // create custom obj
        Customer customer = new Customer(box);

        // 创建2个线程
        Thread thread1 = new Thread(producer);
        Thread thread2 = new Thread(customer);
        // start
        thread1.start();
        thread2.start();
    }

}
